!===============================================================
!
! Funzione Cosine Mixture  (n=2,4)
!
!===============================================================
!			VARIABLE BOUNDS
!===============================================================
!       -1.D0                1.D0          Limits of variable 1
!       -1.D0                1.D0             "        "      2
!       -1.D0                1.D0             "        "      3
!       -1.D0                1.D0             "        "      4

SUBROUTINE COSMIX(X,N,F)

      IMPLICIT NONE

      INTEGER          :: N
      DOUBLE PRECISION :: X(N), F

      DOUBLE PRECISION, PARAMETER :: PI = 3.1415923

      INTEGER          :: I

      F = 0.0D0

      DO I=1,N
         F = F + 0.1D0*DCOS(5.0D0*PI*X(I))-X(I)**2
      END DO
      
      F = - F

	  !IF(N == 2) F = F + 0.2d0
	  !IF(N == 4) F = F + 0.4d0

      RETURN

END
